package net.gxnun.xiaoyuan.core.message.response;

import net.gxnun.xiaoyuan.core.share.MessageToXStreamUtils;
import net.gxnun.xiaoyuan.core.share.MsgType;

import com.thoughtworks.xstream.XStream;

public class ResponseModel {
    
    private Object msg;
    private XStream xs = null;
    
    public void setValue(ResponseMusicMsg msg){
        this.msg = msg;
        xs = MessageToXStreamUtils.getInstance().getXStream(MsgType.VoiceResponse);
    }
    
    public void setValue(ResponseTextMsg msg){
        this.msg = msg;
        xs = MessageToXStreamUtils.getInstance().getXStream(MsgType.TextResponse);
    }
    
    public void setValue(ResponsePictureMsg msg){
        this.msg = msg;
        xs = MessageToXStreamUtils.getInstance().getXStream(MsgType.ImageResponse);
    }
    
    
    public String toXml(){
        
        return xs.toXML(msg);
    }
}
